﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Broker.View.ProductView;
using BrokerBase.Lib.Product;

namespace Broker.View.Converter
{
    public class PeriodConstraintConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            PeriodConstraintType pc = (PeriodConstraintType)value;

            string result = null;

            switch (pc)
            {
                case PeriodConstraintType.None:
                    result= "无限制";
                    break;
                case PeriodConstraintType.LessOrEqual:
                    result= "小于等于";
                    break;
                case PeriodConstraintType.Equal:
                    result= "必须等于";
                    break;
            }

            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
